package com.itedge.infrastructure.service.taskdata;

import com.itedge.infrastructure.service.domain.IEntityService;

/**
 * Interface for services operating on task data Entities.
 * 
 * @author jhe
 *
 * @param <T>
 */
public interface ITaskDataEntityService<T> extends IEntityService<T> {
	
	/**
	 * Attempts to lock task data instance with given taskId.
	 * 
	 * @param taskId
	 * @param lockedBy
	 * @return true if instance was locked, false if it was already modified 
	 * or locked by another user
	 */
	public boolean lock(String taskId, String lockedBy);
	
	/**
	 * Finds task data entity by process task reference. 
	 * 
	 * @param taskId
	 * @return task data entity with linked task instance which has id specified in taskId parameter
	 */
	public T findEntityByProcessTaskId(String taskId);

}
